import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  //登陆路由
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  //首页路由
  {
    path: '/',
    name: 'Index',
    component: () => import(/* webpackChunkName: "about" */ '../views/Index.vue'),
    redirect:'/mypage',//默认页面
    children:[
      {
        path: '/mypage',
        name: 'mypage',
        component: () => import(/* webpackChunkName: "about" */ '../components/mypage.vue'),
      },
      //用户管理模块
      {
        path: '/users',
        name: 'Users',
        component: () => import(/* webpackChunkName: "about" */ '../components/UserControl/users.vue'),
        meta:{
          bread:['用户管理','用户列表']
        }
      },
      //权限管理模块
      {
        path: '/roles',
        name: 'Roles',
        component: () => import(/* webpackChunkName: "about" */ '../components/power/roles.vue'),
        meta:{
          bread:['权限管理','角色列表']
        }
      },
      {
        path: '/rights',
        name: 'Rights',
        component: () => import(/* webpackChunkName: "about" */ '../components/power/rights.vue'),
        meta:{
          bread:['权限管理','权限列表']
        }
      },
      //商品管理模块
      {
        path: '/goods',
        name: 'Goods',
        component: () => import(/* webpackChunkName: "about" */ '../components/shop/goods.vue'),
        meta:{
          bread:['商品管理','商品列表']
        }
      },
      {
        path: '/params',
        name: 'Params',
        component: () => import(/* webpackChunkName: "about" */ '../components/shop/params.vue'),
        meta:{
          bread:['商品管理','分类参数']
        }
      },
      {
        path: '/categories',
        name: 'Categories',
        component: () => import(/* webpackChunkName: "about" */ '../components/shop/categories.vue'),
        meta:{
          bread:['商品管理','商品分类']
        }
      },
      //订单管理模块
      {
        path: '/orders',
        name: 'Orders',
        component: () => import(/* webpackChunkName: "about" */ '../components/oms/orders.vue'),
        meta:{
          bread:['订单管理','订单列表']
        }
      },
      //数据统计模块
      {
        path: '/reports',
        name: 'reports',
        component: () => import(/* webpackChunkName: "about" */ '../components/data/reports.vue'),
        meta:{
          bread:['数据统计','数据报表']
        }
      },

    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
